package com.conferenceroom.service;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.service.IService;
import com.conferenceroom.dto.AjaxResult;
import com.conferenceroom.dto.ReservationRequest;
import com.conferenceroom.entity.Orders;
import com.conferenceroom.vo.OrderWithCaltime;
import com.conferenceroom.vo.ReservationOrder;
import com.conferenceroom.vo.refundOrder;

import java.util.List;

public interface OrdersService extends IService<Orders> {
    //返回所有有倒计时的订单
    List<OrderWithCaltime> listWithTime(Integer userId);
    //根据订单id返回倒计时订单
    OrderWithCaltime getOrderWithCountdownById(Integer orderId);
    List<Orders> list(QueryWrapper<Orders> queryWrapper);

    IPage<Orders> pageByCondition(IPage<Orders> page, Orders order);
    //创建订单
    ReservationOrder createReservation(ReservationRequest request);

    //模拟支付
    AjaxResult payOrder(Integer orderId);

    AjaxResult cancelUnpaidOrder(Integer orderId);
     List<refundOrder> getRefundableOrdersWithRefundFee();

     void calculateRefundFee(refundOrder order);

    boolean updateOrderStatusById(Integer orderId, Integer newStatus);

    /**
     * 修改订单状态并计算退款金额
     *
     * @param orderId 订单ID
     * @return 退款金额
     */
    Integer updateOrderStatusWithRefund(Integer orderId);

    IPage<Orders> pageByUserIds(IPage<Orders> page, List<Integer> userIds);


}


